package com.example.wanjialei.controller;

import com.example.wanjialei.pojo.Advisory;
import com.example.wanjialei.pojo.User;
import com.example.wanjialei.service.AdvisoryService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@CrossOrigin
@RestController
public class AdvisoryController {
    @Resource
    private AdvisoryService advisoryService;

    @RequestMapping("/getAdvisoryInfo")
    public Map<String,Object> getAdvisoryInfo(Advisory advisory){
        return advisoryService.selectAll(advisory);
    }

    @RequestMapping("/modifyAdvisoryInfoById")
    public Map<String,Object> modifyAdvisoryInfoById(@RequestBody Advisory advisory){
        return advisoryService.modifyById(advisory);
    }
    @RequestMapping("/deleteAdvisoryById")
    public Map<String,Object> deleteAdvisoryById(@RequestBody Advisory advisory){
        return advisoryService.deleteById(advisory);
    }
    @RequestMapping("/insertAdvisoryInfo")
    public Map<String,Object> insertAdvisoryInfo(@RequestBody Advisory advisory){
        return advisoryService.insert(advisory);
    }
}
